//
//  NewsThreeTableViewCell.m
//  WangYi
//
//  Created by dllo on 15/11/12.
//  Copyright © 2015年 0. All rights reserved.
//

#import "NewsThreeTableViewCell.h"
#import "DaoHangModel.h"
@implementation NewsThreeTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatSubViews];
    }
    
    return self;
}


-(void)creatSubViews{
    
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH*2, HEIGHT*30, WIDTH*375/3-WIDTH*5,HEIGHT* 130)];
    self.headImageView.backgroundColor = [UIColor redColor];
    self.headImageView.layer.masksToBounds =YES;
    self.headImageView.layer.cornerRadius = HEIGHT*10;
    [self.contentView addSubview:self.headImageView];
    self.headImageView2 = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH*375/3, HEIGHT*30, WIDTH*375/3-WIDTH*5,HEIGHT* 130)];
    self.headImageView2.backgroundColor = [UIColor redColor];
    self.headImageView2.layer.masksToBounds =YES;
    self.headImageView2.layer.cornerRadius = HEIGHT*10;
    [self.contentView addSubview:self.headImageView2];
    self.headImageView3 = [[UIImageView alloc]initWithFrame:CGRectMake(WIDTH*375/3 + WIDTH*375/3, HEIGHT*30, WIDTH*375/3-WIDTH*5,HEIGHT* 130)];
    self.headImageView3.backgroundColor = [UIColor redColor];
    [self.contentView addSubview:self.headImageView3];
    self.headImageView3.layer.masksToBounds =YES;
    self.headImageView3.layer.cornerRadius = HEIGHT*10;
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH*0, HEIGHT*0, WIDTH*375 , HEIGHT*30)];
    self.titleLabel.font = [UIFont systemFontOfSize:HEIGHT*19];
    self.titleLabel.numberOfLines = 0;
    [self.contentView addSubview:self.titleLabel];
    
    
}

-(void)setModel:(DaoHangModel *)model{
    
    _model = model;
    
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.imgsrc] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
     [self.headImageView2 sd_setImageWithURL:[NSURL URLWithString:model.imgextra[0][@"imgsrc"]] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
     [self.headImageView3 sd_setImageWithURL:[NSURL URLWithString:model.imgextra[1][@"imgsrc"]] placeholderImage:[UIImage imageNamed:@"zhanwei.png"]];
    self.titleLabel.text = model.title;
    
    
}


@end
